<!DOCTYPE html>
<html lang="zh">
<head>
    <title>${metadata.alias!}</title>
    <script src="${site.dynamicPath!}resource/js/jquery-1.9.1.min.js"></script>
    <style>
        .red{color:#f00;}
    </style>
</head>
<body>
    <header>
        <h1>${(site.name)!}</h1>
    </header>
    <nav>
        <a href="${base}">Home</a>
<@_categoryList>
    <#list page.list as a>
        <a href="${a.url!}" target="_blank">${a.name}</a>
    </#list>
</@_categoryList>
    </nav>
    <main>
        <#if user??>
            <p>${user.nickName},您已经登录了! 您可以选择<a href="logout.html"><@t.page 'logout'/></a></p>
        <#else>
            <form action="${site.dynamicPath}doRegister.do" method="post">
                <#if error??>
                    <p class="red">${springMacroRequestContext.getMessage(error,error)}</p>
                </#if>
                <p><input type="text" name="name" placeholder="<@t.page 'user.username'/>" title="<@t.page 'user.username'/>" value="${name!}"/></p>
                <p>4位以上数字、字母、下划线,不以数字开始</p>
                <p><input type="text" name="nickName" placeholder="<@t.page 'user.nickname'/>" title="<@t.page 'user.nickname'/>" value="${nickname!}"/></p>
                <p>2位以上数字、字母、汉字、下划线</p>
                <p><input type="password" name="password" placeholder="<@t.page 'password'/>" title="<@t.page 'password'/>"/></p>
                <p><input type="password" name="repassword" placeholder="<@t.page 'repeat_password'/>" title="<@t.page 'repeat_password'/>"/></p>
                <p>
                    <input type="hidden" name="returnUrl" value="${site.sitePath}"/>
                    <input type="submit" value="<@t.page 'register'/>"/>
                </p>
                <p>已有账号?请<a href="login.html"><@t.page 'login'/></a></p>
            </form>
        </#if>
    </main>
    <footer>
        Copyright &copy; ${.now?string('yyyy')}
    </footer>
<script>
function logout(){
    $.post("${site.dynamicPath}doLogout.do",function(){
        window.location.href='${site.sitePath}';
    });
}
</script>
</body>
</html>